package  com.diamond.action;

import java.util.List;

import javax.servlet.http.HttpServletRequest;

import org.apache.struts2.ServletActionContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.diamond.bo.BaseFunctionBO;
import com.diamond.facade.BaseFunctionFacade;
import com.diamond.util.JsonMSG;
import com.opensymphony.xwork2.ActionSupport;

/**
 * PermissionAction ������
 * @author JSmart Tools
 */
public class BaseFunctionAction extends ActionSupport {

	private static Logger log=LoggerFactory.getLogger(BaseFunctionAction.class);
	private static final long serialVersionUID = -5640574915281699127L;
	private HttpServletRequest request = ServletActionContext.getRequest();
//	private IPermissionService permissionService;
	private BaseFunctionFacade baseFunctionFacade;
	private BaseFunctionBO baseFunctionBo;
	private List dataList;
	private String tips;
	private String json;
	
	public String queryAllBaseFunction() {
		 try {
			List<BaseFunctionBO> list = baseFunctionFacade.queryAllBaseFunction();
			this.json=JsonMSG.sucess(list).toJson();
		} catch (Exception e) {
			e.printStackTrace();
			log.error("查询失败",e);
			this.json=JsonMSG.failed("查询失败！").toJson();
		}
		return "json";
	}

	public BaseFunctionFacade getBaseFunctionFacade() {
		return baseFunctionFacade;
	}

	public void setBaseFunctionFacade(BaseFunctionFacade baseFuncationFacade) {
		this.baseFunctionFacade = baseFuncationFacade;
	}

	public String getJson() {
		return json;
	}

	public void setJson(String json) {
		this.json = json;
	}

	public List getDataList() {
		return dataList;
	}

	public void setDataList(List dataList) {
		this.dataList = dataList;
	}

	public BaseFunctionBO getBaseFunctionBo() {
		return baseFunctionBo;
	}

	public void setBaseFunctionBo(BaseFunctionBO baseFunctionBo) {
		this.baseFunctionBo = baseFunctionBo;
	}

	public void setPermissionFacade(BaseFunctionFacade permissionFacade) {
		this.baseFunctionFacade = permissionFacade;
	}

	public BaseFunctionBO getBaseFunction() {
		return baseFunctionBo;
	}

	public void setPermission(BaseFunctionBO baseFunctionBo) {
		this.baseFunctionBo = baseFunctionBo;
	}
    
	public String getTips() {
		return tips;
	}

	public void setTips(String tips) {
		this.tips = tips;
	}
}
